package Try;

public class Computer {
    public void openComputer() {
        System.out.println("打开电脑");
    }
    public void closeComputer() {
        System.out.println("关闭电脑");
    }

    public void useDevice(IUSB str) {
        str.openDevice();
        if ( str instanceof Mouse) {
            Mouse mouse = (Mouse)str;
            mouse.dian();
        }else if(str instanceof Jianpan) {
            Jianpan jianpan = (Jianpan)str;
            jianpan.input();
        }
        str.closeDevice();
    }

}
